class MobilePhone:
    def __init__(self, brand, model, price, memory):
        self.brand = brand
        self.model = model
        self.__price = price  # 私有属性
        self.memory = memory

    def get_brand(self):
        return self.brand

    def get_model(self):
        return self.model

    def get_price(self):
        return self.__price

    def get_memory(self):
        return self.memory

    def set_price(self, new_price):
        if new_price > 0:
            self.__price = new_price
        else:
            print("价格不能小于等于 0")


if __name__ == '__main__':
    phone = MobilePhone("oppo", "oppo Find X7 ultra", 8000, "512GB")
    print(f"品牌: {phone.get_brand()}")
    print(f"型号: {phone.get_model()}")
    print(f"价格: {phone.get_price()}")
    print(f"内存容量: {phone.get_memory()}")

    phone.set_price(9000)
    print(f"修改后的价格: {phone.get_price()}")

    phone.set_price(-100)
    print(f"再次检查价格: {phone.get_price()}")